<?php
/**
 * Created by PhpStorm.
 * User: lifeilin
 * Date: 2017/6/14 0014
 * Time: 10:47
 */

namespace Cohuna\Services;

use Phalcon\Mvc\User\Component;

/**
 * Class BaseService
 * @package BaiyangDaojia\Services
 * @property \Redis $redis;
 * @property \Phalcon\Cache\BackendInterface $cache 缓存操作
 * @property \Phalcon\Logger\Multiple $logger 日志记录
 */
abstract class ServiceBase extends Component
{
    private function __construct()
    {
    }

    /**
     * @var static
     */
    protected static $instance = null;
    /**
     * 单例
     * @return static
     */
    public static function getInstance()
    {
        if (empty(static::$instance)) {
            static::$instance = new static();
        }
        return static::$instance;
    }
}